from asyncio import sleep

from selenium import webdriver
from selenium.webdriver.common.by import By

options = webdriver.ChromeOptions()

# options.add_argument('--headless')

driver = webdriver.Chrome('D:\chromedriver_win32\chromedriver.exe')

driver.get('http://www.baidu.com/s?ie=UTF-8&wd=python')

# driver.find_element_by_id()
# driver.find_element_by_link_text()
# driver.find_element_by_xpath()
# driver.find_element_by_css_selector()
# driver.find_element_by_partial_link_text()

logo = driver.find_element(By.ID, 'result_logo')
print(logo)
print(logo.get_attribute('href'))
# driver.find_element(By.LINK_TEXT)
# driver.find_element(By.XPATH)
# driver.find_element(By.CSS_SELECTOR)
# driver.find_element(By.PARTIAL_LINK_TEXT)

# sleep(3)
driver.quit()
